import { createStore } from "vuex";
const moduleA = {
  state: () => ({
    count: 0
  }),
  mutations: {
    increment (state) {
      // 这里的 `state` 对象是模块的局部状态
      state.count++
    }
  },

  getters: {
    doubleCount (state) {
      return state.count * 2
    }
  }
}
const store = createStore({
  state: {
    menuCollapse: false,
    windowWidth:0,
    windowHeight:0,
  },
  mutations: {
    changeMenuCollapse(state, data) {
      state.menuCollapse = data;
    },
    changeWindowWidth(state, data){
      state.windowWidth = data;
    },
    changeWindowHeight(state, data){
      state.windowHeight = data;
    }
  },
  modules : {
    a: moduleA,
  },
});

export default store;
